package com.lwz.mediator.computer;

public class Client {

	public static void main(String[] args) {
		MainBoard mainBoard = new MainBoard();
		//同事间知道中介器
		CPU cpu = new CPU(mainBoard);
		CDDriver cdDriver = new CDDriver(mainBoard);
		SoundCard soundCard = new SoundCard(mainBoard);
		VideoCard videoCard = new VideoCard(mainBoard);
		//中介器知道同事
		mainBoard.setCpu(cpu);
		mainBoard.setCdDriver(cdDriver);
		mainBoard.setSoundCard(soundCard);
		mainBoard.setVideoCard(videoCard);
		
		cdDriver.readCD();
	}

}
